# -*- encoding=utf8 -*-
__author__ = "chen"

import random

from common.common_util import *


def bangpai():
    connect_device(f"Windows:///")
    try:
        wait(Template(r"tpl1710764162384.png", record_pos=(0.244, -0.132), resolution=(1920, 1080)),500)
        wait(Template(r"tpl1710763904944.png", record_pos=(0.028, -0.084), resolution=(1920, 1080)),50)
        pos = wait(Template(r"tpl1710763904944.png", record_pos=(0.028, -0.084), resolution=(1920, 1080)))
        x = random.randint(-2, 2)
        y = random.randint(-2, 2)
        sleep(2)
        touch((pos[0] + x, pos[1] + y), times=2)
        return pos
    except :
        print("未找到c")
        return None
if __name__ == '__main__':
    minimize_pycham()  # 最小化pycharm
    for i in range(100):
        bangpai()




